home *** CD-ROM | disk | FTP | other *** search
- procedure TForm1.Button1Click(Sender: TObject);
- var
- LoopX, LoopY: Word;
- begin
- { save typing this all the time }
- with Image1.Picture do
- { Canvas property is only in bitmaps }
- if Graphic is TBitmap then
- with Graphic as TBitmap do
- { invert all pixels a column at a time }
- for LoopX := 0 to Pred(Width) do
- begin
- for LoopY := 0 to Pred(Height) do
- begin
- Canvas.Pixels[LoopX, LoopY] := clWhite - Canvas.Pixels[LoopX, LoopY];
- end;
- { standard technique to stop flickering on VGA }
- while Port[$3DA] and 8 = 0 do;
- { be multi-user friendly - yield after each column }
- Application.ProcessMessages;
- { also let user terminate app }
- if Application.Terminated then
- Break;
- end;
- end;
-